package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum TencentIMUserTagEnum {
    TAG_PROFILE_IM_NICK("Tag_Profile_IM_Nick"),
    TAG_PROFILE_IM_IMAGE("Tag_Profile_IM_Image");

    private String code;

    TencentIMUserTagEnum(String code){
        this.code = code;
    }

    public static TencentIMUserTagEnum byCode(String code) {
        for (TencentIMUserTagEnum e: TencentIMUserTagEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
    public static boolean isNickname(String code){
        return TAG_PROFILE_IM_NICK.code.equalsIgnoreCase(code);
    }
    public static boolean isAvatarUrl(String code){
        return TAG_PROFILE_IM_IMAGE.code.equalsIgnoreCase(code);
    }
}
